<?php
	
	require_once('../includes/config.php');
	require_once('../includes/functions.php');
	
	// Retrieve base HTML
	$pageStr = buildStandardPage('Edit User Profile','Edit User Profile');
	
	$content = '';
	
	if(isMobile()){
		$content .= 'Detected Mobile!';
	}
	else{			
		if(true == isBankManager()){
			// activate the specified account
			$updateQuery = buildUpdateStatement('account', array('active'=>true), $_GET[$ACCOUNT_ID]);
			$result = executeSQL($updateQuery, 'Failed to update the user\'s information.');
			
			// redirect to the accounts page
			header('Location: ' . $ACCOUNTS_URL);
		}
		else{ // Redirect everyone but bank managers back to the site homepage
			header('Location: ' . $SITE_URL);
		}
	}
	
	$pageStr = str_Replace('<!--content-->', $content, $pageStr);
	
	/**
	 * Send the generated HTML to the client's browser
	 */
	echo $pageStr;
	?>